Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Restore isCleanNewPost selector #9668

Merged
merged 1 commit into from
Sep 6, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Sep 6, 2018

Previously: #8831
Related Slack conversation: https://wordpress.slack.com/archives/C02QB2JS7/p1536218969000100?thread_ts=1536160199.000100&cid=C02QB2JS7 (link requires registration)

This pull request seeks to restore an isCleanNewPost selector which was previously removed as part of the removal of its sole consumer within the editor package. It has surfaced that there were third-party integrations which depended upon this selector. As no alternative exists and it appears to be a useful selector for integrations, it has been restored here. A note has been included to indicate that it is not in use by the editor package itself.

Testing instructions:

There is no impact on the application.

Ensure unit tests pass:

npm run test-unit packages/editor/src/store/test/selectors.js

cc @ZebulanStanphill

@aduth aduth added the [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. label Sep 6, 2018
@aduth aduth added this to the 3.8 milestone Sep 6, 2018
@aduth aduth requested review from tofumatt and mtias September 6, 2018 14:59
@ZebulanStanphill
Copy link
Member

This fixes the issue with Divi for me. 👍

Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might actually use this over just using isEditedPostSaveable in #9608, but I'll amend the selector if that happens.

Before merging please add/restore the selector docs I (just recently!) removed in bbca724 for isCleanNewPost. 😄

@aduth
Copy link
Member Author

aduth commented Sep 6, 2018

As no alternative exists

I suppose it should be clarified that there is an alternative, which is simply to use the underlying isEditedPostDirty and isEditedPostNew to recreate the condition satisfying isCleanNewPost, as @tofumatt had done in #9608 .

@aduth aduth force-pushed the restore/is-clean-new-post-selector branch from 1ca81d1 to cca95ab Compare September 6, 2018 17:12
@aduth
Copy link
Member Author

aduth commented Sep 6, 2018

Before merging please add/restore the selector docs I (just recently!) removed in bbca724 for isCleanNewPost. 😄

Thanks for the reminder. Updated in rebased cca95ab.

@tofumatt
Copy link
Member

tofumatt commented Sep 6, 2018

Update looks good. :shipit:

@aduth aduth merged commit 9a6bf39 into master Sep 6, 2018
@aduth aduth deleted the restore/is-clean-new-post-selector branch September 6, 2018 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants